// src/store/apiSlice/profileApiSlice.ts
import { apiSlice } from "@store/apiSlice/index";

export const profileApiSlice = apiSlice.injectEndpoints({
    endpoints: (builder) => ({
        // 获取登录用户个人资料
        requestProfile: builder.query<ProfileResponse, undefined>({
            query: () => ({
                url: "/patient/myUser",
            }),
        }),
        //关注取消关注
        focus: builder.mutation<HealthResponse<{id:string}>,{ type: FocusType; id: string }>({
         query:(body)=>({ url: "/like", method: "POST", body })
        })
    }),
});

export const { useRequestProfileQuery , useFocusMutation} = profileApiSlice;